{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>商品管理</span>
            <span class="icon-angle-right"></span>
            <span>商品管理</span>
            <span class="icon-angle-right"></span>
            <span>商品列表</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <table class="m-table">
                <tr>
                    <th>
                        <div class="m-options cf">
                            <div class="m-opts fl"><a href="{:url('add')}" class="u-btn"><i class="icon-plus"></i>添加商品</a></div>
                            <div class="m-search fr">
                                <form action="" class="layui-form">
                                    <label for="">商品分类</label>
                                    <div class="lay-select">
                                        <select name="category_id">
                                            <option value="0">请选择分类</option>
                                            {foreach name="categories" item="v"}
                                            <option value="{$v.id}"{if condition="!$v['is_last']"} disabled{/if}{if condition="$category_id eq $v['id']"} selected{/if}>{$v.html|html_entity_decode}|-{$v.name}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                    <label for="">商品状态</label>
                                    <div class="lay-select m-select-tiny">
                                        <select name="is_sale">
                                            <option value="-1"{if condition="$is_sale eq -1"} selected{/if}>全部商品</option>
                                            <option value="1"{if condition="$is_sale eq 1"} selected{/if}>上架</option>
                                            <option value="0"{if condition="$is_sale eq 0"} selected{/if}>下架</option>
                                        </select>
                                    </div>
<!--                                    <div class="lay-select m-select-tiny">-->
<!--                                        <select name="is_latest">-->
<!--                                            <option value="-1"{if condition="$is_latest eq -1"} selected{/if}>全部商品</option>-->
<!--                                            <option value="1"{if condition="$is_latest eq 1"} selected{/if}>新品</option>-->
<!--                                        </select>-->
<!--                                    </div>-->
<!--                                    <div class="lay-select m-select-tiny">-->
<!--                                        <select name="is_hot_sale">-->
<!--                                            <option value="-1"{if condition="$is_hot_sale eq -1"} selected{/if}>全部商品</option>-->
<!--                                            <option value="1"{if condition="$is_hot_sale eq 1"} selected{/if}>热卖</option>-->
<!--                                        </select>-->
<!--                                    </div>-->
<!--                                    <div class="lay-select m-select-tiny">-->
<!--                                        <select name="is_recommand">-->
<!--                                            <option value="-1"{if condition="$is_recommand eq -1"} selected{/if}>全部商品</option>-->
<!--                                            <option value="1"{if condition="$is_recommand eq 1"} selected{/if}>推荐</option>-->
<!--                                        </select>-->
<!--                                    </div>-->
                                    <label for="keywords">关键词</label>
                                    <input type="text" name="keywords" id="keywords" class="u-ipt u-ipt-def" placeholder="请输入要查询的关键词" value="{$keywords}" />
                                    <input type="submit" class="u-btn u-search" value="查看" />
                                </form>
                            </div>
                        </div>
                    </th>
                </tr>
            </table>
            <form class="layui-form m-list-form">
                <table class="m-table mt-10">
                    <tbody class="datas">
                        <tr>
                            <th width="5%">排序</th>
                            <th width="5%">ID</th>
                            <th width="8%">所在分类</th>
                            <th width="26%">商品名称</th>
                            <th width="8%">所需积分</th>
<!--                            <th width="8%">总库存</th>-->
                            <th width="10%">兑换量</th>
                            <th width="10%">状态</th>
                            <th width="10%">录入时间</th>
                            <th width="10%">操作</th>
                        </tr>
                        {foreach name="data" item="v"}
                        <tr>
                            <td><input type="text" name="list_order[{$v.id}]" lay-skin="primary" class="u-ipt u-ipt-tiny" value="{$v.list_order}" /></td>
                            <td>{$v.id}</td>
                            <td>{$v.category_name}</td>
                            <td>{$v.goods_name}</td>
                            <td>{$v.sale_price}积分</td>
                            <td>{$v.actual_sale_nums}</td>
                            <td class="m-goods-status">
                                <p class="clearfix"><span class="u-status{$v.is_sale ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_sale" data-value="{$v.is_sale}">{$v.is_sale_txt}</span>
<!--                                <span class="u-status{$v.is_latest ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_latest" data-value="{$v.is_latest}">{$v.is_latest_txt}</span></p>-->
<!--                                <p class="clearfix"><span class="u-status{$v.is_hot_sale ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_hot_sale" data-value="{$v.is_hot_sale}">{$v.is_hot_sale_txt}</span>-->
<!--                                <span class="u-status{$v.is_recommand ? ' u-status-primary' : ' u-status-danger'}" data-id="{$v.id}" data-key="is_recommand" data-value="{$v.is_recommand}">{$v.is_recommand_txt}</span>-->
                                </p>
                            </td>
                            <td>{$v.create_time}</td>
                            <td class="m-opt"><a href="{:url('add', ['id' => $v.id])}" title="编辑"><i class="icon-pencil"></i></a><a href="javascript:;" title="删除" class="u-del" data-id="{$v.id}"><i class="icon-trash"></i></a></td>
                        </tr>
                        {/foreach}
                        <tr>
                            <td colspan="10" class="m-options"><button class="u-btn u-batch-sorted"><i class="icon-sort"></i>批量排序</button></td>
                        </tr>
                    </tbody>
                </table>
            </form>
            {include file="public:page" /}
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="laypage" /}
{/block}